#!/usr/bin/env python
import sys
from killerbee import kbutils

arg_gpsdev = None

def show_dev():
    kbdev_info = kbutils.devlist(gps=arg_gpsdev)
    print "Dev\tProduct String\tSerial Number"
    for dev in kbdev_info:
        print "%s\t%s\t%s" % (dev[0], dev[1], dev[2])
    print "Found %d devices." % len(kbdev_info)

if __name__ == '__main__':
    while len(sys.argv) > 1:
        op = sys.argv.pop(1)
        if op == '-g':
            arg_gpsdev = sys.argv.pop(1)
    show_dev()
